package com.sixmac.dao;

import com.sixmac.entity.UserAccount;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2016/6/3 0003 上午 11:47.
 */
public interface UserAccountDao extends JpaRepository<UserAccount, Integer> {

    @Query("select a from UserAccount a where a.userId = ?1 and a.type = ?2 and a.status = 0")
    public List<UserAccount> findListByIdAndType(Integer userId, Integer type);

    @Query("select a from UserAccount a where a.account.id = ?1 and a.type = ?2 and a.status = 0")
    public List<UserAccount> findListByParams(Integer accountId, Integer type);
}